package com.ssy.lingxi.contract.entity;

import com.ssy.lingxi.contract.handler.converter.JpaJsonToIntegerConverter;

import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 请款单
 * @author 伍将
 * @date 2021/3/9
 * @version 2.0.0
 */
@Entity
@Table(schema = "public", name = "con_apply_amount_order",
        indexes = {@Index(name = "con_apply_amount_order_contract_id_idx", columnList = "contractId"),
                @Index(name = "con_apply_amount_order_pay_plan_id_idx", columnList = "payPlanId"),
                @Index(name = "con_apply_amount_order_member_idx", columnList = "memberId,roleId"),
                @Index(name = "con_apply_amount_order_order_time_idx", columnList = "orderTime"),
                @Index(name = "con_apply_amount_order_status_idx", columnList = "status")})
public class ApplyAmountOrderDO implements Serializable {
    private static final long serialVersionUID = -6004524345282478582L;

    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "apply_amount_order_seq")
    @SequenceGenerator(sequenceName = "con_apply_amount_order_seq", name = "apply_amount_order_seq", allocationSize = 1)
    private Long id;

    /**
     * 请款编号
     */
    @Column(columnDefinition = "varchar(16)")
    private String applyNo;

    /**
     * 请款摘要
     */
    @Column(columnDefinition = "varchar(60)")
    private String applyAbstract;

    /**
     * 状态:ApplyAmountOrderStatusEnum
     */
    @Column(columnDefinition = "int")
    private Integer status;

    /**
     * 任务id
     */
    @Column(columnDefinition = "varchar(50)")
    private String taskId;

    /**
     * 工作流当前步骤
     */
    @Column(columnDefinition = "int")
    private Integer taskStep;

    /**
     * 工作流步骤记录
     */
    @Convert(converter = JpaJsonToIntegerConverter.class)
    @Column(columnDefinition = "jsonb")
    private List<Integer> taskStepRecord = new ArrayList<>();

    /**
     * 工作流类型：ProcessEnum
     */
    @Column(columnDefinition = "int")
    private Integer taskType;

    /**
     * 会员id
     */
    @Column(columnDefinition = "int8")
    private Long memberId;

    /**
     * 会员角色id
     */
    @Column(columnDefinition = "int8")
    private Long roleId;

    /**
     * 会员名称
     */
    @Column(columnDefinition = "varchar(50)")
    private String memberName;

    /**
     * 合同id
     */
    @Column(columnDefinition = "int8")
    private Long contractId;

    /**
     * 合同编号
     */
    @Column(columnDefinition = "varchar(16)")
    private String contractNo;

    /**
     * 收款会员id
     */
    @Column(columnDefinition = "int8")
    private Long payeeMemberId;

    /**
     * 收款会员角色id
     */
    @Column(columnDefinition = "int8")
    private Long payeeRoleId;

    /**
     * 收款会员名称
     */
    @Column(columnDefinition = "varchar(50)")
    private String payeeMemberName;

    /**
     * 收款账户
     */
    @Column(columnDefinition = "varchar(50)")
    private String payeeName;

    /**
     * 银行账号
     */
    @Column(columnDefinition = "varchar(50)")
    private String bankAccount;

    /**
     * 开户行
     */
    @Column(columnDefinition = "varchar(50)")
    private String bankDeposit;

    /**
     * 付款计划id
     */
    @Column(columnDefinition = "int8")
    private Long payPlanId;

    /**
     * 付款阶段
     */
    @Column(columnDefinition = "varchar(300)")
    private String payStage;

    /**
     * 付款比率
     */
    @Column(columnDefinition = "decimal")
    private Double payRatio;

    /**
     * 合同总额
     */
    @Column(columnDefinition = "decimal")
    private Double contractAmount;

    /**
     * 请款金额
     */
    @Column(columnDefinition = "decimal")
    private Double applyAmount;

    /**
     * 预计付款时间
     */
    @Column(columnDefinition = "int8")
    private Long expectPayTime;

    /**
     * 付款方式：ContractPayWayEnum
     */
    @Column(columnDefinition = "int")
    private Integer payWay;

    /**
     * 付款参数（账期天数/请款日）
     */
    @Column(columnDefinition = "int")
    private Integer payParam;

    /**
     * 支付方式：2.线下支付
     */
    @Column(columnDefinition = "int")
    private Integer moneyPayWay;

    /**
     * 支付渠道：5.线下支付线上确认
     */
    @Column(columnDefinition = "int8")
    private Long moneyPayChannel;

    /**
     * 备注
     */
    @Column(columnDefinition = "varchar(160)")
    private String remark;

    /**
     * 作废时间
     */
    @Column(columnDefinition = "int8")
    private Long invalidTime;

    /**
     * 作废原因
     */
    @Column(columnDefinition = "varchar(160)")
    private String invalidReason;

    /**
     * 单据时间
     */
    @Column(columnDefinition = "int8")
    private Long orderTime;

    /**
     * 付款金额
     */
    @Column(columnDefinition = "decimal")
    private Double payAmount;

    /**
     * 付款时间
     */
    @Column(columnDefinition = "int8")
    private Long payTime;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "int8")
    private Long createTime;

    /**
     * 更新时间
     */
    @Column(columnDefinition = "int8")
    private Long updateTime;
    /**
     * 数据来源：1：付款计划，2：合同执行  3：手工
     */
    @Column(columnDefinition = "int2")
    private Integer sourceType;

    public Double getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(Double payAmount) {
        this.payAmount = payAmount;
    }

    public Long getPayTime() {
        return payTime;
    }

    public void setPayTime(Long payTime) {
        this.payTime = payTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getApplyNo() {
        return applyNo;
    }

    public void setApplyNo(String applyNo) {
        this.applyNo = applyNo;
    }

    public String getApplyAbstract() {
        return applyAbstract;
    }

    public void setApplyAbstract(String applyAbstract) {
        this.applyAbstract = applyAbstract;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public Long getContractId() {
        return contractId;
    }

    public void setContractId(Long contractId) {
        this.contractId = contractId;
    }

    public String getContractNo() {
        return contractNo;
    }

    public void setContractNo(String contractNo) {
        this.contractNo = contractNo;
    }

    public Long getPayeeMemberId() {
        return payeeMemberId;
    }

    public void setPayeeMemberId(Long payeeMemberId) {
        this.payeeMemberId = payeeMemberId;
    }

    public Long getPayeeRoleId() {
        return payeeRoleId;
    }

    public void setPayeeRoleId(Long payeeRoleId) {
        this.payeeRoleId = payeeRoleId;
    }

    public String getPayeeMemberName() {
        return payeeMemberName;
    }

    public void setPayeeMemberName(String payeeMemberName) {
        this.payeeMemberName = payeeMemberName;
    }

    public String getPayeeName() {
        return payeeName;
    }

    public void setPayeeName(String payeeName) {
        this.payeeName = payeeName;
    }

    public String getBankAccount() {
        return bankAccount;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }

    public String getBankDeposit() {
        return bankDeposit;
    }

    public void setBankDeposit(String bankDeposit) {
        this.bankDeposit = bankDeposit;
    }

    public Long getPayPlanId() {
        return payPlanId;
    }

    public void setPayPlanId(Long payPlanId) {
        this.payPlanId = payPlanId;
    }

    public Double getPayRatio() {
        return payRatio;
    }

    public void setPayRatio(Double payRatio) {
        this.payRatio = payRatio;
    }

    public Double getApplyAmount() {
        return applyAmount;
    }

    public void setApplyAmount(Double applyAmount) {
        this.applyAmount = applyAmount;
    }

    public Long getExpectPayTime() {
        return expectPayTime;
    }

    public void setExpectPayTime(Long expectPayTime) {
        this.expectPayTime = expectPayTime;
    }

    public Integer getPayWay() {
        return payWay;
    }

    public void setPayWay(Integer payWay) {
        this.payWay = payWay;
    }

    public Integer getPayParam() {
        return payParam;
    }

    public void setPayParam(Integer payParam) {
        this.payParam = payParam;
    }

    public Integer getMoneyPayWay() {
        return moneyPayWay;
    }

    public void setMoneyPayWay(Integer moneyPayWay) {
        this.moneyPayWay = moneyPayWay;
    }

    public Long getMoneyPayChannel() {
        return moneyPayChannel;
    }

    public void setMoneyPayChannel(Long moneyPayChannel) {
        this.moneyPayChannel = moneyPayChannel;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public String getInvalidReason() {
        return invalidReason;
    }

    public void setInvalidReason(String invalidReason) {
        this.invalidReason = invalidReason;
    }

    public Long getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Long orderTime) {
        this.orderTime = orderTime;
    }

    public Double getContractAmount() {
        return contractAmount;
    }

    public void setContractAmount(Double contractAmount) {
        this.contractAmount = contractAmount;
    }

    public String getPayStage() {
        return payStage;
    }

    public void setPayStage(String payStage) {
        this.payStage = payStage;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public Integer getTaskStep() {
        return taskStep;
    }

    public void setTaskStep(Integer taskStep) {
        this.taskStep = taskStep;
    }

    public List<Integer> getTaskStepRecord() {
        return taskStepRecord;
    }

    public void setTaskStepRecord(List<Integer> taskStepRecord) {
        this.taskStepRecord = taskStepRecord;
    }

    public Integer getTaskType() {
        return taskType;
    }

    public void setTaskType(Integer taskType) {
        this.taskType = taskType;
    }

    public Long getInvalidTime() {
        return invalidTime;
    }

    public void setInvalidTime(Long invalidTime) {
        this.invalidTime = invalidTime;
    }

    public Integer getSourceType() {
        return sourceType;
    }

    public void setSourceType(Integer sourceType) {
        this.sourceType = sourceType;
    }
}
